<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>博客管理</title>
    <link rel="icon" href="/img/favicon.ico">
    <style>
        .yu-main {
            padding-top: 0px;
        }
    </style>
</head>
<body>
<div th:include="header.html"></div>

<div class="am-cf admin-main yu-main">
        <!-- sidebar start -->
        <div class="admin-sidebar am-offcanvas" id="admin-offcanvas">
            <div class="am-offcanvas-bar admin-offcanvas-bar">
                <ul class="am-list admin-sidebar-list">
                    <li><a href="#"><span class="am-icon-table"></span> 普通用户管理</a></li>
                    <li><a href="/admin?page=article"><span class="am-icon-table"></span> 文章管理</a></li>
                    <li><a href="/admin?page=comment"><span class="am-icon-pencil-square-o"></span> 评论管理</a></li>
                    <li><a href="/admin?page=user-disable"><span class="am-icon-table"></span> 封禁用户管理</a></li>
                    <li><a href="/admin?page=catalog"><span class="am-icon-table"></span> 目录管理</a></li>
                </ul>

                <div class="am-panel am-panel-default admin-sidebar-panel">
                    <div class="am-panel-bd">
                        <p><span class="am-icon-bookmark"></span> 公告</p>
                        <p>时光静好，与君语；细水流年，与君同。</p>
                    </div>
                </div>
            </div>
        </div>
        <!-- sidebar end -->

        <!-- content start -->
        <div class="admin-content">
            <div class="admin-content-body">
                <div class="am-cf am-padding">
                    <div class="am-fl am-cf"><strong class="am-text-primary am-text-lg">普通用户管理</strong> /
                        <small>普通用户管理</small>
                    </div>
                </div>

                <div class="am-g">
                    <div class="am-u-sm-12">
                        <table class="am-table am-table-bd am-table-striped admin-content-table">
                            <thead>
                            <tr>
                                <th>用户头像</th>
                                <th>用户ID</th>
                                <th>用户名</th>
                                <th>个人资料</th>
                                <th>撤销管理员权限</th>
                            </tr>
                            </thead>
                            <tbody>
                            <tr th:each="commonUser : ${commonUsers}">
                                <td><img th:src="${commonUser.getUserPic()}" width="50" height="50"></td>
                                <td th:text="${commonUser.getId()}"></td>
                                <td th:text="${commonUser.getUsername()}"></td>
                                <td><a th:href="'/user?userId=' + ${commonUser.getId()}"
                                       class="am-btn am-btn-primary am-btn-sm">查看</a></td>
                                <td>
                                    <form action="/admin-disable-user" method="post">
                                        <input type="hidden" name="user-id" th:value="${commonUser.getId()}">
                                        <input type="hidden" th:name="${_csrf.parameterName}"
                                               th:value="${_csrf.token}"/>
                                        <input type="submit" th:value="封禁" class="am-btn am-btn-primary am-btn-sm">
                                    </form>
                                </td>
                            </tr>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>

            <footer class="admin-content-footer">
                <hr>
                <div th:include="footer.html"></div>
            </footer>
        </div>
        <!-- content end -->

    </div>

    <a href="#" class="am-icon-btn am-icon-th-list am-show-sm-only admin-menu" data-am-offcanvas="{target: '#admin-offcanvas'}"></a>


    <script src="/js/jquery.min.js"></script>
<script src="/js/amazeui.min.js"></script>
    <script src="/js/app.js"></script>
<link rel="stylesheet" href="/css/amazeui.min.css"/>
<link rel="stylesheet" href="/css/admin.css">
</body>
</html>